#! /bin/sh
# Miggbzo -- apply MIGration by Gaussian Beams for Zero Offset
set -x

WIDTH=600
HEIGHT=600
XOFF1=0
YOFF1=0
XOFF2=650
YOFF2=650
demo=2

nt=500 dt=.004 ft=0.0 dtsegy=4000
nx=180 dx=20  fx=0.0
nz=500 dz=5  fz=0.0
#fmin=10 fmax=50    # see param2 in model.dir 

# make velocity function
cd miggbzo.dir

# create the background velocity models
Unisam2

# plot background velocity model 1 --- constant velocity 2500
ximage < junkv n1=500 n2=180  \
	wbox=$WIDTH hbox=$HEIGHT xbox=$XOFF1 ybox=$YOFF1 \
title="Background velocity profile " \
d1=5 d2=20 &

suaddhead < demo${demo}traces ns=500  ftn=1 |
sushw key=dt a=$dtsegy > junk.su

# Gaussian beam migration
sumiggbzo verbose=1 <junk.su >junkmgb vfile=junkv \
	 dt=$dt dx=$dx dz=$dz nz=$nz fz=$fz 

suximage <junkmgb  perc=99   \
	wbox=$WIDTH hbox=$HEIGHT xbox=$XOFF2 ybox=$YOFF1 \
	label1="Depth" label2="Distance" \
	title="GB migration --- constant background" \
	x1beg=0 x1end=2525 x2beg=0 x2end=3600 &

exit 0
